package com.foreknow.tijian.controller;

import com.foreknow.tijian.po.Orders;
import com.foreknow.tijian.po.OverallResult;
import com.foreknow.tijian.service.Impl.OrdersServiceImpl;
import com.foreknow.tijian.service.Impl.OverallResultServiceImpl;
import com.foreknow.tijian.service.OrdersService;
import com.foreknow.tijian.service.OverallResultService;

import javax.servlet.http.HttpServletRequest;
import java.sql.SQLException;
import java.util.List;

public class OverallResultController {
    /**
     * HttpServletRequest
     * 提供一些方法用于获取前台传递到后台的请求参数
     * 客户端向服务端发送请求的url地址
//     * http://localhost:8080/tijian/OverallResultController/listOverallResultByOrderId
     * @return
     */
    public Object listOverallResultByOrderId (HttpServletRequest request) throws SQLException {
        int res=0;
        //获取前台的请求参数
        String orderId=request.getParameter("orderId");
        OverallResult result=new OverallResult();
        result.setOrderId(orderId);
        //调用Service中的方法
       OverallResultService overallResultService=new OverallResultServiceImpl();
        List<OverallResult> list=overallResultService.listOverallResultByOrderId(result);
        return list;
    }
}
